package hn.cch.demo.factory;

import java.util.ArrayList;
import java.util.List;

public class TemplateFactory {

    private final List<TemplateProcessor> templateProcessors = new ArrayList<>();

    public Object getObject() {
        Object object = new Object();
        templateProcessors.forEach(templateProcessor -> {
            templateProcessor.method(object);
        });
        return object;
    }

    public void addTemplateProcessor(TemplateProcessor templateProcessor) {
        templateProcessors.add(templateProcessor);
    }
}
